package FlappyBird;

import Common.Game;

import javax.swing.*;

public class App implements Game {

    public static int WIDTH = 500;
    public static int HEIGHT = 520;

    @Override
    public void run() {
        JFrame frame = new JFrame();
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        frame.setSize(WIDTH, HEIGHT);
        frame.setLocationRelativeTo(null);

        Keyboard keyboard = Keyboard.getInstance();
        frame.addKeyListener(keyboard);

        GamePanel panel = new GamePanel();
        frame.add(panel);
    }

    public static void main(String[] args) {
        App app = new App();
        app.run();
    }
}
